package com.lilinling.yinzhi.user.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.lilinling.yinzhi.user.entity.MakerInfoDescEntity;
import com.lilinling.yinzhi.user.service.MakerInfoDescService;
import com.lilinling.common.utils.PageUtils;
import com.lilinling.common.utils.R;



/**
 * maker信息介绍
 *
 * @author lichenglin
 * @email lilinling15@gmail.com
 * @date 2021-01-19 22:19:29
 */
@RestController
@RequestMapping("user/makerinfodesc")
public class MakerInfoDescController {
    @Autowired
    private MakerInfoDescService makerInfoDescService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("user:makerinfodesc:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = makerInfoDescService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{makerId}")
    //@RequiresPermissions("user:makerinfodesc:info")
    public R info(@PathVariable("makerId") Long makerId){
		MakerInfoDescEntity makerInfoDesc = makerInfoDescService.getById(makerId);

        return R.ok().put("makerInfoDesc", makerInfoDesc);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("user:makerinfodesc:save")
    public R save(@RequestBody MakerInfoDescEntity makerInfoDesc){
		makerInfoDescService.save(makerInfoDesc);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("user:makerinfodesc:update")
    public R update(@RequestBody MakerInfoDescEntity makerInfoDesc){
		makerInfoDescService.updateById(makerInfoDesc);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("user:makerinfodesc:delete")
    public R delete(@RequestBody Long[] makerIds){
		makerInfoDescService.removeByIds(Arrays.asList(makerIds));

        return R.ok();
    }

}
